/**********************************************************************
 *
 *  Copyright (C) 2003 ALi.  All Rights Reserved.
 *
 *  File:   rsc.h
 *
 *  Contents:    module to analysis the raw data of special resource .
 *
 *  History:
 *      Date	     	By	       Reason
 *   ========	   =============   =============
 *   10/14/2003      Linda Liu	       Create
 * 
 *********************************************************************/
#ifndef _RSC_LIB_H
#define _RSC_LIB_H

#include <types.h>
#include <api/libosd/osd_lib.h>
#include <api/libosd/osd_common_draw.h>

///////////////////////////////////////////////////////////////
// Language definition

/*
typedef enum
{
	NULL_ENV,
	ENGLISH_ENV,
	FRANCE_ENV,
	GERMANY_ENV,
 	ITALY_ENV,
 	RUSSIAN_ENV,
 	SPANISH_ENV,
 	TURKISH_ENV,
 	PORTUGUESE_ENV,
 	ARABIC_ENV,
	POLISH_ENV,
 	CHINESE_ENV,
	INDONESIAN_ENV,
	IRAN_EVN,
	GREECE_EVN,
	SWEDISH_EVN,
	SLAVIC_EVN,
	DUTCH_EVN,
	SLOVAK_EVN,
	ROMANIAN_EVN,
	HUNGARIAN_EVN,
	CZECH_EVN,
	BULGARIAN_EVN,
	DANISH_EVN,
	FINNISH_EVN,
	ESTONIAN_EVN,
	CATANIAN_EVN,
	PERSIAN_EVN,
	LATIN_EVN,
}LANG_GROUP_t;
*/

typedef enum
{
    ENGLISH_ENV = 0,
#if(AOV_THAI_SUPPORT_ENABLE == SYS_FUNC_ON)
	THAI_ENV,
#endif
#if(AOV_VIE_SUPPORT_ENABLE == SYS_FUNC_ON)
	VIE_ENV,
#endif
#if(AOV_CHS_SUPPORT_ENABLE == SYS_FUNC_ON)
	CHS_ENV,
#endif
#if(AOV_MALAY_SUPPORT_ENABLE == SYS_FUNC_ON)
	MALAY_ENV,
#endif
#if(AOV_IND_SUPPORT_ENABLE == SYS_FUNC_ON)
	INDONESIAN_ENV,
#endif
#if(AOV_ARABIC_SUPPORT_ENABLE == SYS_FUNC_ON)
    ARABIC_ENV,
#endif
#if(AOV_TAMIL_SUPPORT_ENABLE == SYS_FUNC_ON)
	TAMIL_ENV,
#endif
#if(AOV_RUS_SUPPORT_ENABLE == SYS_FUNC_ON)
	RUS_ENV,
#endif
#if(AOV_UKRA_SUPPORT_ENABLE == SYS_FUNC_ON)
	UKR_ENV,
#endif
	ENDLANG_ENV
}LANG_GROUP_t;

#define DEFAULT_LANG_ENV    ENGLISH_ENV//GERMANY_ENV


///////////////////////////////////////////////////////////////
// Font definition
#define LIB_FONT_NULL		0x1000
#define LIB_FONT_DEFAULT    0x1100
#define LIB_FONT_LATIN1     0x1200
#define LIB_FONT_LATINE     0x1300
#define LIB_FONT_GREEK	      0x1400
#define LIB_FONT_CYRILLIC	    0x1500
#define LIB_FONT_ARABIC	    0x1600
#define LIB_FONT_MASSCHAR1		0x1D00
#define LIB_FONT_MASSCHAR		0x1F00
#define LIB_FONT_THAI       0x1700
#if(AOV_VIE_SUPPORT_ENABLE == SYS_FUNC_ON)
#define LIB_FONT_VIE       0x1800
#endif
#if(AOV_CHS_SUPPORT_ENABLE == SYS_FUNC_ON)
#define LIB_FONT_CHS       0x1900
#endif
#if(AOV_TAMIL_SUPPORT_ENABLE == SYS_FUNC_ON)
#define LIB_FONT_TAM       0x1A00
#endif
///////////////////////////////////////////////////////////////
// String definition

#define LIB_STRING_ENGLISH	0x2100
#if(AOV_THAI_SUPPORT_ENABLE == SYS_FUNC_ON)
#define LIB_STRING_THAI		0x2200
#endif
#if(AOV_VIE_SUPPORT_ENABLE == SYS_FUNC_ON)
#define LIB_STRING_VIE		0x2300
#endif
#if(AOV_CHS_SUPPORT_ENABLE == SYS_FUNC_ON)
#define LIB_STRING_CHS		0x2400
#endif
#if(AOV_MALAY_SUPPORT_ENABLE == SYS_FUNC_ON)
#define LIB_STRING_MALAY	0x2500
#endif
#if(AOV_IND_SUPPORT_ENABLE == SYS_FUNC_ON)
#define LIB_STRING_IND		0x2600
#endif
#if(AOV_ARABIC_SUPPORT_ENABLE == SYS_FUNC_ON)
#define LIB_STRING_ARABIC	0x2700
#endif
#if(AOV_TAMIL_SUPPORT_ENABLE == SYS_FUNC_ON)
#define LIB_STRING_TAMIL	0x2800
#endif
#if(AOV_RUS_SUPPORT_ENABLE == SYS_FUNC_ON)
#define LIB_STRING_RUS	0x2900
#endif
#if(AOV_UKRA_SUPPORT_ENABLE == SYS_FUNC_ON)//Ukrainian
#define LIB_STRING_UKR	0x2A00
#endif
///////////////////////////////////////////////////////////////
// Pallete definition

#define LIB_PALLETE_8BPP	0x4080
#define LIB_PALLETE_4BPP	0x4040
#define LIB_PALLETE_2BPP	0x4020



#define LIB_CHAR_ASCII 0
/***************************************************************************************/
typedef struct tagLANG_TABLE
{
	UINT16	LangId;
	ID_RSC	StrId;
	ID_RSC	CharType;
	ID_RSC	FontId;
} LANG_TABLE, *lpLANG_TABLE;

typedef struct 
{

	UINT8			height;
	UINT16			uFontCnt;
	const UINT8*	width;
	const UINT32*	data;
	const UINT16*	uIdxTab;
	UINT8 			bit_cnt;
}font_t;

struct font_real_region
{   
    UINT8 left_most;
    UINT8 right_most;
    UINT8 top_most;
    UINT8 bottom_most;
};

struct shift_offset
{
    UINT8 left_offset;
    UINT8 right_offset;
    UINT8 up_offset;
    UINT8 down_offset;
};

/*******************************************
***-the functions the client can visit***-*/

UINT16	OSD_GetLangEnvironment(void);
BOOL	OSD_SetLangEnvironment(UINT16 wLangClass);

BOOL	OSD_GetObjInfo(UINT16 wLibClass,UINT16 uIndex,lpOBJECTINFO pObjectInfo);
UINT8* 	OSD_GetRscObjData(UINT16 wLibClass,UINT16 uIndex,lpOBJECTINFO objectInfo);
UINT8*	OSD_GetRscObjData_ext(UINT16 wLibClass, UINT16 uIndex, OBJECTINFO *pObjectInfo, UINT8 *font_bitmap_ext);//vic100507#1
UINT8* 	OSD_GetThaiFontData(UINT16 wLibClass,struct thai_cell *cell,OBJECTINFO* pObjectInfo);

BOOL   	OSD_ReleaseObjData(UINT8* lpDataBuf,lpOBJECTINFO pObjectInfo);

ID_RSC  OSD_GetDefaultFontLib(UINT16 uChar);


PWINSTYLE OSDExt_GetWinStyle(UINT8 bStyleIdx);
ID_RSC    OSDExt_GetMsgLibId(UINT16 EnvID);

#ifdef BIDIRECTIONAL_OSD_STYLE
BOOL	OSD_GetMirrorFlag(void);
#endif
/*******************************************************************************/

#endif
